<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>专项招聘</title>
    @@include("../template/src.html")
</head>
<style>
</style>

<body ms-controller="index">
    @@include("../template/head.html")
    <div class="main-container">
        <div class="sub-nav">
            <nav class="navbar">
                <div class="container-fluid">
                    <div class="navbar-header">
                        <a class="navbar-brand logo-c" href="#">
                            <img alt="logo" src="../images/icon_part.png">
                        </a>
                    </div>
                    <p class="navbar-text">
                        专项招聘
                    </p>
                    <p class="navbar-text crumbs-split">
                        >
                    </p>
                    <p class="navbar-text router-nav">
                        {{checkedTitle}}
                    </p>
                </div>
            </nav>
        </div>
    </div>
    <div class="main-container">
        <div class="sn-tab">
            <ul class="ul-nav">
                <li class="ul-nav-li active" ms-click="changeTitle(menuList[0])">
                    <span class="ul-nav-li-title">{{menuList[0].Name}}</span>
                </li>
                <li ms-repeat-el="menuList" class="ul-nav-li" ms-if-loop="$index>0" ms-click="changeTitle(el)">
                    <span class="ul-nav-li-title">{{el.Name}}</span>
                </li>
            </ul>
            <ul class="ul-container">
                <li style="display: block;" ms-repeat-el="menuList" class="ul-container-li" ms-if-loop="$index==0">
                    <div ms-include-src="menuList[0].PageUrl"></div>
                </li>
                <li ms-repeat-el="menuList" class="ul-container-li" ms-if-loop="$index>0">
                    <div ms-include-src="el.PageUrl"></div>
                </li>
            </ul>
        </div>
    </div>
    @@include("../template/footer.html")
</body>
<script>
setTimeout(init, 0);

function init() {
    var pageId = config.pageConfig.zxzp;
    myPost(GetNodeByParentID, {parentID: pageId}, function(data) {
        $("#" + pageId).addClass('active');
        console.log(data)
        if (data.Status == true) {
            for (var i = 0; i < data.Message.length; i++) {
                var item = data.Message[i];
                var names = item.Name.split('-');
                if (names.length > 0) {
                    item.Name = names[1];
                }
                item.PageUrl = ".."+item.PageUrl;
            }
            vm.menuList = data.Message;
        }
    });
    $(".router-nav").click(function(event) {        
         var index = $(".ul-nav li.active").index();
         var li = $(".ul-container li").eq(index);
         li.find(".sub-level").hide();
         li.find(".super-level").show();
         $('.navbar-text.sub').remove();
    });
}
var vm = avalon.define({
    $id: "index",
    menuList: [],
    checkedTitle: '招聘公告',
    changeTitle: function(el) {
        vm.checkedTitle = el.Name;
        el.PageUrl = el.PageUrl+" ";
    }
});
</script>

</html>
